Natural shaped regions for motion compensation

ABSTRACT

A method of irregular motion compensation includes using contours of objects in a reference image to tile the reference image into a plurality of irregular shapes, and mapping each irregular shape to a location in a target image by assigning a motion vector to each irregular shape.

FIELD OF INVENTION

The invention is related to the field of video compression.

BACKGROUND

High compression gains for video sequences can be achieved by removing temporal redundancies between images. For example, to encode an image, a temporal prediction of the image to be encoded is generated based on previously encoded images. The temporal prediction is compared with the actual image to determine the prediction error, and the prediction error is encoded. The prediction can be made with conventional block-based motion estimation and compensation methods.

Motion compensation and estimation methods are used to find a reference block in one or more reference images to predict the location of a corresponding target block in the target image, so that only motion vectors and a prediction residual of the target needs to be coded. These methods perform block matching to identify a reference block of pixels in the reference image that is most similar to a corresponding target block in the target image. The pixel distance between the reference block and corresponding target block is the motion vector for the target block.

The motion compensation procedure begins by tiling the target image and the reference image into fixed size blocks. FIG. 1 shows two standard shape definitions that are typically applied to the reference and target images. The first definition 110 tiles an image using non-overlapping 16-by-16 blocks of pixels. The second definition 120 uses 4-by4 blocks. These fixed size blocks, which are located at pre-defined areas in the target and reference images, are unrelated to the shapes and locations of objects in the image.

Generally, pixels on the target image are assigned to exactly one block. This one-to-one mapping is referred to as tiling. Each block is assigned a motion vector that maps it to a corresponding portion on a reference image. A compensated image, which approximates the target image, is then formed by using the mapping defmed by the motion vectors to identify the corresponding reference blocks and then copying the pixel values from the reference block to the area defined by the target block.

The error between the desired target image and the compensated image is determined, and a residual correction for this error is then encoded. It is assumed that both the encoder and decoder have access to the same reference images. Therefore, only the motion vectors and residual corrections are transmitted to accomplish video coding.

A successful video coder balances many factors to generate a high-quality target image using limited computational resources. Of all these factors, the selection of reference data is possibly the most critical to video quality and the most costly in terms of computational resources. For example, if an object moves from one location in the reference image to another location in the target image, a motion vector should be able to map the object from the reference image to the target image.

However, conventional motion compensation methods use motion vectors that map pre-determined blocks, which rarely correspond to boundaries of moving objects. Because the shapes of the pre-determined blocks are unrelated to natural contours on moving objects in the reference image, the motion vector maps to a reference block that is partially related to the moving object, and partially unrelated to the moving object. This causes an increase in the error of the compensated image.

Therefore, there is a need for a method to identify natural contours of moving objects in the reference images to improve the quality of motion compensation.

SUMMARY

A method of irregular motion compensation includes using contours of objects in a reference image to tile the reference image into a plurality of irregular shapes, and mapping each irregular shape to a location in a target image by assigning a motion vector to each irregular shape.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and may be better understood by referring to the following description in conjunction with the accompanying drawings, in which:

FIG. 1 shows two standard shape definitions that are typically applied to the target images.

FIG. 2 shows an example of video coding using a motion compensation method that utilizes irregularly shaped regions and irregularly spaced motion vectors.

FIG. 3 shows an example of a method for finding natural contours of objects in a reference image.

FIG. 4 shows an example of an irregular shape that is generated using the method of FIG. 3.

FIG. 5 shows an example of an irregular shape combined with a fixed size block.

FIG. 6 shows an example of performing video coding for encoding an image of video data using the irregular motion compensation method.

FIG. 7 shows an example of decoding an image using the irregular compensation method.

FIG. 8 shows an example of a system that uses the irregular compensation method.

DETAILED DESCRIPTION

In the following description, reference is made to the accompanying drawings which form a part hereof, and in which is shown by way of illustration a specific embodiment in which the invention may be practiced. It is to be understood that other embodiments may be utilized and structural changes may be made without departing from the scope of the present invention. For example, skilled artisans will understand that the terms field, frame, image, or picture that are used to describe the various embodiments are generally interchangeable as used with reference to video data.

A motion compensation method uses irregular shapes that are dynamically determined from the content of the reference image. Each irregular shape identifies a group of pixels that corresponds to a portion of a natural object in the reference image. The boundary of the shape therefore corresponds to the boundary of at least a portion of the object, rather than to a pre-determined block that is not associated with the object. When a motion compensation method assigns a motion vector to the irregular shape, the resulting mapping automatically aligns boundary of the irregular shape with the boundary of the object in the target image, and the compensation error is reduced.

An example of using motion compensation utilizing irregular shapes within a video coder is shown in FIG. 2. At 210 an encoder finds natural contours of objects in a reference image, and generates irregular shapes from the natural contours to replace pre-defined fixed size blocks of conventional motion compensation. At 220 a motion vector is assigned to each irregular shape to map the shape to a location on the target image. At 230 fixed size blocks are defined on the target image. At 240 a motion vector is assigned to each fixed size block to map to a location on the reference image. At 250, the motion vectors for the irregular shapes and the motion vectors for the fixed size blocks are combined. At 255 a motion vector selection method selects a set of motion vectors that satisfies a rate-distortion criteria from the combined motion vectors for the irregular shapes and the fixed size blocks. In some embodiments, the selection method determines a compensated value for each target pixel that is mapped to multiple shapes, or no shapes at all. At 260 the set of motion vectors and the reference image are transmitted to a decoder. At 270, the irregular shapes are generated at the decoder. At 280, the compensated image is formed.

Referring to 210 in greater detail, an example of a method for finding natural contours of objects in the reference image is shown in FIG. 3. At 305, a reference image is divided into initial groups of pixels that are unrelated to image features. At 310, group statistics are calculated for each initial group of pixels. One example of a group statistic is the color variance: Color Variance=Variance(Y)+2*Variance(U)+2*Variance(V) where Variance(Y) is a statistical measure of variance applied to the luminance component of the pixels within the group and Variance(U) and Variance(V) are the variance of the color difference components of the pixels within the group.

At 315, if a stopping criteria is reached, the method ends at 320. Examples of stopping criteria include a pre-defined number of iterations, a number of changes, a total homogeneity measure. Another example is a time limit. When the method ends, the current groups are output for use as reference shapes.

Otherwise, at 322 a pixel is selected as a candidate for changing groups. In some embodiments, the pixel is selected randomly (or pseudo-randomly), selected according to a pre-defined order, or selected using a selection rule. At 325, the method determines whether the pixel is a neighbor to at least one pixel in another group. If not, the method returns to 320 to select another candidate pixel.

If so, then at 330 a candidate change is made to each neighboring group. For example, a candidate pixel in one group (group A) can be a neighbor to three groups (groups B, C, and D). To determine whether the candidate change results in a decrease of color variance for group A and an increase in color variance for the other groups, at 335 a candidate homogeneity score is computed for each candidate change. For example, a candidate change at 330 moves the candidate pixel from its current group (group A), to one of its neighbors, (for example, group B). Then, a candidate homogeneity score is calculated at 335 for group A and group B for this candidate change. Candidate changes are also made at 330 for groups C and D, and candidate homogeneity scores are also calculated at 335 for these candidate changes.

In one embodiment, the candidate homogeneity score records the maximum color variance of the group from which the candidate pixel was removed, and the group to which the candidate pixel is added. The smaller the homogeneity score, the more homogenous the resulting group is deemed to be. For example, when the starting color variance for group A is relatively high and decreases from the candidate change, and the color variance for group B is relatively small and increases from the candidate change, then the candidate homogeneity score is relatively low.

At 340, the best candidate homogeneity score is determined. In some embodiments, the best homogeneity score comes from a minmax criteria: the best score is that which yields the smallest maximum color variance. At 342, the method determines if the best candidate homogeneity score is better than the current homogeneity score. If so, then the pixel is moved to another group at 345, and at 350 any group statistics are updated to reflect this change. Otherwise, no change is made and the method returns to 315.

After performing the method for finding natural contours of objects in the reference image, pre-defined blocks are transformed from pixels unrelated to image features into an irregular shape of pixels that follow image features. Each resulting irregular shape of pixels is not necessarily a connected set. An example of an irregular shape that is generated using the method of FIG. 3 is shown in FIG. 4. An initial group of pixels 410 in a reference image 430 is transformed into a group of pixels with an irregular shape 420 having contours that are correlated with features of the reference image. In some embodiments, the initial group 410 is a pre-defined shape, such as a block, or is input from another source, such as a previously encoded image. The method outputs an irregular shape which, in this example, is a disconnected group of pixels 420. If desired, the disconnectedness can be controlled by limiting the total number of iterations, or by favoring connectedness in the homogeneity score.

If a target pixel is mapped to multiple shapes, a target pixel value is determined using the multiple shapes. Regions in the target image can map to multiple shapes in a single reference image because the method for finding natural contours of objects in the reference image tiles the reference image instead of the target image. Conversely, there can be pixels in the target image which do not map to any pixels on the irregularly tiled reference image.

In some embodiments, a value for a target pixel that maps to multiple reference shapes is determined from an average of the reference pixel values in the multiple reference shapes as the compensated value of the target pixel. For example, a recursive formula for computing the average of N reference pixel values is especially useful when the total number of reference shapes is unknown in advance. That is, given x _(N), which is the average of x₁, X_(2, . . . ,) X_(N) pixel values, compute x _(N+1) using the recursive update formula: ${\overset{\_}{x}}_{N + 1} = \frac{\left( {{N\quad{\overset{\_}{x}}_{N}} + x_{N + 1}} \right)}{N + 1}$ and store the running average, x _(N), and the running number of reference shapes, N.

In some embodiments, target pixels that are not mapped to any reference pixels are compensated using a pre-determined value, for example 128, or an interpolated value. Alternatively, fixed size blocks that cover the entire target image are generated. The motion vectors for the fixed size blocks are then combined with the motion vectors for the irregular shapes. For example, as shown in FIG. 5, motion vector 512 maps irregular shape 510 from reference image 515 to a matching shape of pixels 517 in target image 530. A motion vector 522 maps a pre-defined fixed size block 527 from target image 530 to a matching fixed size block 520 in reference image 525.

The directionality of the motion vectors 512 and 522 indicates where the initial shape tiling was done. In the case of the pre-defined fixed size block 527, this tiling corresponds to a pre-defined area on the target image 530. Thus, when generating the motion vector 522 for fixed size block 527, a search area 529 in the reference image 525 is examined to identify a displacement of reference block 520 from the corresponding fixed size target block 527. In the case of the irregular shape 510, the tiling was performed on reference image 515. When generating the motion vector 512 for irregular shape 510, a search area 519 in the target image 530 is examined to identify a displacement of the matching shape 517 from the corresponding irregular shape 510 in reference image 515.

The motion vectors for the irregular shapes and fixed size blocks, when combined, form a set of candidate motion vectors. A motion vector selection method selects motion vectors from the candidate set of motion vectors which are nearly optimal from a rate-distortion point of view. The selected motion vectors form an irregular pattern of motion vectors, which are then sent to the decoder. The decoder then uses the motion vectors for the irregular shapes and the motion vectors for the pre-defined fixed size blocks, along with the reference images, to form a compensated image.

The decoder can retrieve the shape of the fixed size block from a shape definition library, or the shape definition of the fixed size block can be transmitted to the decoder. However, the shape definition of the irregular shape is not transmitted to the decoder, in order to reduce the amount of data that is transmitted. Instead, the definition of each irregular shape is generated at the decoder, using the method of FIG. 3. Since both the encoder and decoder have the same reference images, they are able to deduce the same shape information without transmission of additional bits by applying the same method to the reference image to generate the irregular shapes. Therefore, the definitions of the irregular shapes do not need to be sent from the encoder to the decoder. In some embodiments, a few bits specifying a stopping criteria, such as the number of iterations performed, are transmitted to the decoder to guarantee synchronization between the encoder and decoder.

In one embodiment, the compensation method is used in video coding for encoding an image (or frame, or field) of video data, as shown in FIG. 6. At 610, the encoder receives an input target image. (A set of reference images, which contain decoded image data related to the target image, is available to the encoder during the encoding process, and also to the decoder during the decoding process). At 620, the encoder generates irregular shapes and an irregular sampling, or distribution, of motion vectors associated with the target image using the methods shown in FIGS. 2 and 3. At 630, the sampling pattern information (e.g., bits to represent the pattern) is transmitted to a decoder.

At 640, a temporal prediction filtering process is applied to the irregular motion vector sampling pattern to generate a prediction of the target image. At 650, the motion vector values are coded and sent to the decoder. At 660, a residual is generated, which is the actual target data of the target image minus the prediction error from the adaptive filtering process. At 670, the residual is coded, and at 680 is sent to the decoder.

In another embodiment, the irregular pattern of motion vectors and the irregular compensation method are used in decoding a image (or frame, or image) of video data, as shown in FIG. 7. At 710, an encoded residual is received. At 720, the decoder decodes the received encoded residual. At 730, the decoder receives the sample pattern information, reference images, and motion vector values, and generates the irregular shapes using the method of FIG. 3. Then, at 740 the decoder applies an adaptive temporal filter procedure to generate the temporal prediction. At 750, the decoded target image is generated by adding the decoded residual to the temporal prediction.

FIG. 8 shows an example of a system that generates and uses the irregular shapes using the methods of FIGS. 2 and 3. A digital video camera 810 captures images in an electronic form, and processes the images using compression device 820, which uses the motion compensation method during the compression and encoding process. The encoded images are sent over an electronic transmission medium 830 to digital playback device 840. The images are decoded by decoding device 850, which uses the method of FIG. 3 during the decoding process. Camera 810 is illustrative of various image processing apparatuses (e.g., other image capture devices, image editors, image processors, personal and commercial computing platforms, etc.) that include embodiments of the invention. Likewise, decoding device 850 is illustrative of various devices that decode image data.

While the invention is described in terms of embodiments in a specific system environment, those of ordinary skill in the art will recognize that the invention can be practiced, with modification, in other and different hardware and software environments within the spirit and scope of the appended claims. 

1. A method carried out by an electronic data processor, comprising: using contours of objects in a reference image to tile the reference image into a plurality of irregular shapes; and mapping each irregular shape to a location in a target image by assigning a motion vector to each irregular shape.
 2. The method of claim 1, further comprising: tiling the target image into a plurality of fixed size blocks; mapping the fixed size block to an area in the reference image by assigning a motion vector to each fixed size block; and combining the motion vectors for the fixed size blocks and the motion vectors for the irregular shapes into a combined set of motion vectors.
 3. The method of claim 1, further comprising: transmitting the motion vectors to a decoder; and using the transmitted motion vectors and the reference image to form a compensated image.
 4. The method of claim 3, wherein using the transmitted motion vectors and the reference image to form the compensated image comprises: using a decoder to tile the reference image into the plurality of irregular shapes.
 5. The method of claim 4, wherein a portion of a first irregular shape and a portion of a second irregular shape are mapped to an overlapping location in the compensated image, the method further comprising: using the first and second irregular shapes to determine a value for each pixel in the overlapping location.
 6. An apparatus comprising: an irregular shape generator that uses contours of objects in a reference image to tile the reference image into a plurality of irregular shapes; and a motion vector assignment device that maps each irregular shape to a location in a target image by assigning a motion vector to each irregular shape.
 7. The apparatus of claim 6, further comprising: a fixed size tiling device to tile the target image into a plurality of fixed size blocks; a fixed size block assignment device that maps the fixed size block to an area in the reference image by assigning a motion vector to each fixed size block; and a combiner that combines the motion vectors for the fixed size blocks and the motion vectors for the irregular shapes into a combined set of motion vectors.
 8. The apparatus of claim 6, further comprising: a transmitter that transmits the motion vectors and the reference image; and a decoder that receives the transmitted motion vectors and uses the transmitted motion vectors and the reference image to form a compensated image.
 9. The apparatus of claim 8, wherein the decoder is configured to tile the reference image into the plurality of irregular shapes.
 10. The apparatus of claim 9, wherein the decoder is configured to map a portion of a first irregular shape and a portion of a second irregular shape to an overlapping location in the compensated image, the decoder further configured to use the first and second irregular shapes to determine a value for each pixel in the overlapping location.
 11. A computer readable medium storing a computer program of instructions which, when executed by a processing system, cause the system to perform a method comprising: using contours of objects in a reference image to tile the reference image into a plurality of irregular shapes; and mapping each irregular shape to a location in a target image by assigning a motion vector to each irregular shape.
 12. The computer readable medium of claim 11, further comprising: tiling the target image into a plurality of fixed size blocks; mapping the fixed size block to an area in the reference image by assigning a motion vector to each fixed size block; and combining the motion vectors for the fixed size blocks and the motion vectors for the irregular shapes into a combined set of motion vectors.
 13. The computer readable medium of claim 11, further comprising: transmitting the motion vectors and the reference image to a decoder; and using the transmitted motion vectors and the reference image to form a compensated image.
 14. The computer readable medium of claim 13, wherein using the transmitted motion vectors and the reference image to form a compensated image comprises: using a decoder to tile the reference image into the plurality of irregular shapes.
 15. The computer readable medium of claim 14, wherein a portion of a first irregular shape and a portion of a second irregular shape are mapped to an overlapping location in the compensated image, further comprising: using the first and second irregular shapes to determine a value for each pixel in the overlapping location. 